#include "qdrivenamedialog.h"
#include "ui_qdrivenamedialog.h"

#include "../../lib/corelib/qnamevalidator.h"

QDriveNameDialog::QDriveNameDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QDriveNameDialog),
    m_nameEdit(new QNameEdit)
{
    ui->setupUi(this);
    ui->horizontalLayout->addWidget(m_nameEdit,1);
    setProperty("no-ManhattanStyle",true);
    m_nameEdit->setFocus();
}

QDriveNameDialog::~QDriveNameDialog()
{
    delete ui;
}

void QDriveNameDialog::on_calceBtn_clicked()
{
    close();
}

void QDriveNameDialog::on_okBtn_clicked()
{
    QString str=m_nameEdit->value();
    if(str=="")
    {
        return;
    }
    m_name=str;
    close();
}

QString QDriveNameDialog::getName()
{
    return m_name;
}
